package com.alibaba.cola.statemachine;

/**
 * Generic strategy interface used by a state machine to respond
 * events by executing an {@code Action} with a {@link StateContext}.
 *
 * @param <S> the type of state
 * @param <E> the type of event
 * @param <C> the user defined context
 * @author Frank Zhang
 * @date 2020-02-07 2:51 PM
 *
 * 动作
 */
public interface Action<S, E, C> {

    /**
     * 执行action方法
     *
     * @param from 原状态
     * @param to 目标状态
     * @param event 事件
     * @param context 上下文
     */
    void execute(S from, S to, E event, C context);

}
